home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CONVERSI
/
1396.ZIP
/
FIX43_MA.ARC
/
FIX43.ASM
next >
Wrap
Assembly Source File
|
1988-05-26
|
3KB
|
126 lines
title FIX43 -- fix 43 line mode cursor
comment #
The cursor in 43 line is fleeting, at best. This resident program fixes
that by checking for 8x8 characters every timer interrupt, and if the
EGA is in 8x8 mode, the cursor start and end lines are set to their
proper values.
#
;
; Interrupt vector segment definitions.
;
ints segment at 0
org 8*4 ;Point to Int 9 (timer) vector.
int8 label word
org 460h
cursor label word ;Cursor scan lines.
org 485h
points label byte ;Number of scan lines/char.
ints ends
;
; Program segment.
;
fix43 segment
assume CS:fix43,DS:fix43,ES:fix43,SS:fix43
;
; Put service code as low as DOS will allow.
org 5Ch
old8 dw ?,?
trap label word ;Location for interrupt traps.
;
; Start of .COM code - jump to installation.
org 100h
start:
jmp copy ;Go set up traps.
db 13,'FIX43 version 1.0 Copyright (C) 1988 Mark Adler',13,10
db 'All rights reserved.',13,10,'Z'-64
;
; Traps - only assume CS points here.
assume DS:nothing,ES:nothing,SS:nothing
set: ;Traps.
db 'FIX43TSR' ;Identifier to find enable flag.
enbl db 1 ;Enable flag for this fix.
cfix:
;
test byte ptr trap+(enbl-set),1 ;See if enabled.
jz nofix ;If not, skip all this.
push DS
push AX
sub AX,AX ;Point DS to BIOS data area.
mov DS,AX
assume DS:ints
mov AL,points ;Get number of scan lines/character.
cmp AL,8 ;See if 8 instead of 14.
jne not43 ;If not, go on to timer service.
push DX
mov DX,03D4h ;Point to CRTC ports.
mov AX,060Ah ;Set cursor start scan line to 7.
cmp cursor,0707h ;See if line cursor desired.
je lincur ;If so, cursor is a line.
cmp cursor,0607h ;This is also a line cursor.
je lincur
mov AH,2 ;Else cursor is a block.
lincur:
out DX,AX
mov AX,000Bh ;Set cursor end scan line to 0.
out DX,AX
pop DX
not43:
pop AX
pop DS
assume DS:nothing
nofix:
jmp dword ptr old8 ;Go on to original routine.
setlen equ $-set ;End of traps.
;
; Installation code - all segment registers set.
assume DS:fix43,ES:fix43,SS:fix43
copy:
;
; Install traps and tell DOS to leave them in memory.
;
; copy traps to lower memory.
cld
mov SI,offset set
mov DI,offset trap
mov CX,(setlen+1)/2
rep movsw
; insert trap in timer tick interrupt vector.
sub AX,AX
mov ES,AX ;Point to interrupt area.
assume ES:ints
cli ;Disable interrupts during change.
mov AX,int8 ;Save old pointer.
mov old8,AX
mov AX,int8+2
mov old8+2,AX
mov int8,offset trap+(cfix-set) ;Change Int 8 to the trap.
mov int8+2,CS
sti ;Interrupts OK now.
; tell DOS to keep the traps in memory and exit.
mov DX,offset trap+setlen ;Amount to keep.
int 27h ;Exit and remain resident.
fix43 ends
end start